﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Mgx.Job.Jobs;
using Quartz;

namespace Mgx.Jobs
{
    public class TestJob : BaseJob,IJob
    {
        public void Execute(IJobExecutionContext context)
        {
            base.log.Info("任务 TestJob 开始");
            Stopwatch watch = new Stopwatch();
            watch.Start();

            try
            {
                Test();
            }
            catch (Exception ex)
            {
                base.log.Info("任务 TestJob 异常:" + ex);
            }

            watch.Stop();
            base.log.Info("任务 TestJob 结束,任务总耗时：" + watch.ElapsedMilliseconds / 1000 + "秒");
        }


        private void Test()
        {
            for (int i = 0; i < 10; i++)
            {
                Console.WriteLine(i);
            }
        }

    }
}
